package behavior.observer;

/**
 * @author lzp
 * @Date:2023/3/7
 * @description: 管理员订阅产品内容
 */
public class Admin implements ProductObserver {

	private String name;

	public Admin(String name) {
		this.name = name;
	}

	@Override
	public void onPublished(Product product) {
		System.out.printf("管理员【%s】收到了产品【%s】的发布\n", name, product.getName());
	}

	@Override
	public void onPriceChange(Product product) {
		System.out.printf("管理员【%s】收到了产品【%s】的价格变动\n", name, product.getName());
	}
}
